
  <h1>Recherche des machines</h1>
  <br/>
 <div id="newMachineTitle" >
   <% if authenticated? %>
      <%= link_to 'Nouvelle machine', new_machine_path %>
   <%end %>
 </div>
  <br/>
  <div id="newMachineTitle" style="" >
     <% form_tag(:controller=>'machines', :action=>'rechercher') do %>
       <table>
        <tr>
          <td><%= text_field :name , @machine %></td>
          <td><%= submit_tag 'Rechercher' %></td>
        </tr>
      </table>
     <% end %>
  </div>
  <br/>
   <br/>


<table width="100%">
  <tr  bgcolor="#999999">
    <td>Num</td>
    <td>Nom</td>
    <td>Adresse IP</td>
    <td>MAC</td>
    <td>Système</td>
    <td>Memoire</td>
    <td>Espace de stockage</td>
    <td>Salle</td>
    <td colspan="4">Opération</td>
  </tr>

<% @machines.each_with_index do |machine ,index|
    if (index%2==0)
      col ="#CCCCCC"
    else
      col = "#FFFFFF"
    end
    
  %>
   <% p machine %>
    <tr bgcolor="<%=h col %>" >
    <td><%=h machine.id %></td>
    <td><%=h machine.nommachine %></td>
    <td><%=h machine.ipmachine %></td>
    <td><%=h machine.addmac %></td>
    <td><%=h machine.os %></td>
    <td><%=h machine.memoiretotale %></td>
    <td><%=h machine.espacedisquet %></td>
    <td>
             <%=h  machine.nomsalle %>       
    </td>

    <td><%= link_to image_tag("point.png", :size => "16x16", :alt => "Interrogation"), :controller => "machines", :action => "interomachine", :id => machine.id %></td>
        <td><%= link_to image_tag("voir.png", :alt => "Voir"), machine %></td>
        <% if authenticated? %>
        <td><%= link_to image_tag("edit.png", :alt => "Modifier"), edit_machine_path(machine) %></td>
        <td><%= link_to image_tag("supp.png", :alt => "Suppression"), machine, :confirm => 'Etes vous sûr de vouloir supprimer cet enregistrement?', :method => :delete %></td>
        <% end %>
  </tr>
<%  end %>
</table>
  <div>
     <% if flash[:error] %> <div id="error"><%= flash[:error] %></div> <% end %>
  </div>
<br />


<br />
